package com.share.pulsar.config;

import com.share.pulsar.config.property.PurlsarProperty;
import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.client.api.PulsarClientException;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author caifan
 * @created 2021/5/18
 * description:
 */
@Configuration
public class PulsarConfig {

    @Bean
    public PulsarClient pulsarClient(PurlsarProperty property) throws PulsarClientException {
        PulsarClient pulsarClient = PulsarClient.builder().serviceUrl(property.getServiceUrl()).build();

        return pulsarClient;
    }

}
